﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Microsoft.AspNet.SignalR;
using KendoUIGridSignalR.Code;

namespace KendoUIGridSignalR.Hubs
{
    // Author: Otto Neff | webapps-in-action.com
    public class StockHub : Hub
    {
        internal static void Trigger()
        {
            IHubContext context = GlobalHost.ConnectionManager.GetHubContext<StockHub>();
            context.Clients.All.UpdateStock(GetStockData.GetData(""));
        }

        public void GetStock(string id)
        {
            Clients.All.UpdateStock(GetStockData.GetData(id));
        }
    }
}